<?php
include '../../php/conn.php'; 
if ($con) {
	if($_POST)
	{
		$TMid=$_POST['TMid']; 
		$sql = "SELECT * FROM `teachermanagement` WHERE TMid=$TMid";
		//执行sql语句
		$rs = mysql_query($sql);
		//判断是否执行sql语句成功
		if ($rs) {
			//执行成功
			//计算查询出来的数据的总条数
			$num = mysql_num_rows($rs);
			if ($num >= 1) {

				while ($rows = mysql_fetch_assoc($rs)) {
					$arr[] = $rows;
				}
				//返回查询状态及查询数据
				echo '{"status":"200","msg":' . json_encode($arr) . '}';

			} else {
				//没有商品数据
				echo '{"status":"404"}';
			}
		} else {
			//执行失败
			echo '{"status":"0"}';
		}
 
		
	}else
		{
			//执行失败
		echo '{"status":"0"}';
		}
	
}  
//关闭数据库
mysql_close($con);
?>